<link rel="stylesheet" href="{{URL::asset('./css/news/newsHot.css')}}">

<div class="newhotContent" id="newsHotss" v-cloak>
    <div class="newsHot">
        <div class="newhotContent_title">
            <img src="{{URL::asset('./img/news/hot.png')}}"><span>热门新闻</span>
        </div>
        <div class="newhotContent_main">
            <div v-for="(item) in newsHotData" @click="getDetails(item.id)">
                <img src="{{URL::asset('./img/news/laba.png')}}"><span>@{{item.title}}</span>
            </div>
        </div>
    </div>
    <div class="newsNew">
        <div class="newhotContent_title">
            <img src="{{URL::asset('./img/news/news.png')}}"><span>最新新闻</span>
        </div>
        <div class="newhotContent_main">
            <div v-for="(item,index) in newsNewData" @click="getDetails(item.id)">
                <img src="{{URL::asset('./img/news/laba.png')}}"><span>@{{item.title}}</span>
            </div>
        </div>
    </div>
</div>
@section('compontentScipts')
<script>
    $(() => {
        let newsHotss = new Vue({
            el: '#newsHotss',
            data: () => {
                return {
                    newsHotData: [],
                    newsNewData: [],
                    lo: 11
                }
            },
            created() {
                apiAjax("{{ route('home.news.newsCate')}}", 'get', {}, (res) => {
                    if (res.code == 0) {
                        this.newsHotData = res.data.hot;
                        this.newsNewData = res.data.new;
                    } else {
                        this.$message({
                            message: res.msg,
                            type: 'warning'
                        });
                    }
                }, (erro) => {});
            },
            mounted() {

            },
            methods: {
                getDetails(id) {
                    window.location.href = `{{ route('home.news.newsDetails') }}?id=${id}`;
                }
            }
        })
    })
</script>
@endsection
